<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>代理商后台</title>
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  		<!-- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> -->
		<link rel="stylesheet" type="text/css" href="<{STATIC_SERVER}>/layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="<{STATIC_SERVER}>/admin/css/style.css"/>
	</head>
	<body style="width: 100%; height: 100%;">
		<div class="xinsu-login">
			<div class="xinsu-login-content">
				<div class="xinsu-login-form">
					<h2>代理商后台</h2>
					<form class="layui-form" action="" method="post">
						<div class="layui-form-item">
						    <label class="layui-form-label">帐&nbsp;号：</label>
						    <div class="layui-input-block">
						      	<input type="text" name="username" class="layui-input">
						    </div>
						</div>
						<div class="layui-form-item">
						    <label class="layui-form-label">密&nbsp;码：</label>
						    <div class="layui-input-block">
						      	<input type="password" name="password" class="layui-input">
						    </div>
						</div>
						<button class="layui-btn" type="submit">立即登录</button>
						<div class="xinsu-clear"></div>
					</form>
					<p>欢迎来到股票交易管理中心，开启您的财富之路！</p>
				</div>
			</div>
		</div>
		<script src="<{STATIC_SERVER}>/admin/js/jquery-1.12.1.min.js"></script>
		<script src="<{STATIC_SERVER}>/layui/layui.all.js"></script>
		<script>
			$("form").submit(function(){
				var data = $(this).serialize();
				$.ajax({
					type:'post',  
					url : "/<{$common_info.module}>/index/login",
					dataType : 'json',
					data : data,
					success : function(repones) {
						if (repones.status == 1 || repones.status == 2) {
							layer.msg('登录成功', {icon: 1, time: 800}, function(){
								
								if(repones.data.role_id==2){
									location.href = "/<{$common_info.module}>/user";
								}
								else{
									location.href = "/<{$common_info.module}>";
								}
								
							});
						} else {
							layer.msg(repones.msg);return false;
						}
					},
					error : function() {  
						layer.msg('加载数据失败，请重新加载');return false;
					}
				});
				return false;
			})
		</script>
	</body>
</html>